package com.peycard.common;

import java.io.Serializable;

public class ReaderDTO implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private long idReader;
	private String serialNumber;
	private String version;
	private String messageSecurity;
	private String encryptionKey;
	private String username;
	private int isActive;
	private ReaderControlDTO readerControl;
	private MobileUserDTO mobileUser;

	public long getIdReader() {
		return idReader;
	}

	public void setIdReader(long idReader) {
		this.idReader = idReader;
	}

	public String getSerialNumber() {
		return serialNumber;
	}

	public void setSerialNumber(String serialNumber) {
		this.serialNumber = serialNumber;
	}

	public String getVersion() {
		return version;
	}

	public void setVersion(String version) {
		this.version = version;
	}

	public String getMessageSecurity() {
		return messageSecurity;
	}

	public void setMessageSecurity(String messageSecurity) {
		this.messageSecurity = messageSecurity;
	}

	public String getEncryptionKey() {
		return encryptionKey;
	}

	public void setEncryptionKey(String encryptionKey) {
		this.encryptionKey = encryptionKey;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public int getIsActive() {
		return isActive;
	}

	public void setIsActive(int isActive) {
		this.isActive = isActive;
	}

	public ReaderControlDTO getReaderControl() {
		return readerControl;
	}

	public void setReaderControl(ReaderControlDTO readerControl) {
		this.readerControl = readerControl;
	}

	public MobileUserDTO getMobileUser() {
		return mobileUser;
	}

	public void setMobileUser(MobileUserDTO mobileUser) {
		this.mobileUser = mobileUser;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((encryptionKey == null) ? 0 : encryptionKey.hashCode());
		result = prime * result + (int) (idReader ^ (idReader >>> 32));
		result = prime * result + isActive;
		result = prime * result
				+ ((messageSecurity == null) ? 0 : messageSecurity.hashCode());
		result = prime * result
				+ ((mobileUser == null) ? 0 : mobileUser.hashCode());
		result = prime * result
				+ ((readerControl == null) ? 0 : readerControl.hashCode());
		result = prime * result
				+ ((serialNumber == null) ? 0 : serialNumber.hashCode());
		result = prime * result
				+ ((username == null) ? 0 : username.hashCode());
		result = prime * result + ((version == null) ? 0 : version.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ReaderDTO other = (ReaderDTO) obj;
		if (encryptionKey == null) {
			if (other.encryptionKey != null)
				return false;
		} else if (!encryptionKey.equals(other.encryptionKey))
			return false;
		if (idReader != other.idReader)
			return false;
		if (isActive != other.isActive)
			return false;
		if (messageSecurity == null) {
			if (other.messageSecurity != null)
				return false;
		} else if (!messageSecurity.equals(other.messageSecurity))
			return false;
		if (mobileUser == null) {
			if (other.mobileUser != null)
				return false;
		} else if (!mobileUser.equals(other.mobileUser))
			return false;
		if (readerControl == null) {
			if (other.readerControl != null)
				return false;
		} else if (!readerControl.equals(other.readerControl))
			return false;
		if (serialNumber == null) {
			if (other.serialNumber != null)
				return false;
		} else if (!serialNumber.equals(other.serialNumber))
			return false;
		if (username == null) {
			if (other.username != null)
				return false;
		} else if (!username.equals(other.username))
			return false;
		if (version == null) {
			if (other.version != null)
				return false;
		} else if (!version.equals(other.version))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "ReaderDTO [idReader=" + idReader + ", serialNumber="
				+ serialNumber + ", version=" + version + ", messageSecurity="
				+ messageSecurity + ", encryptionKey=" + encryptionKey
				+ ", username=" + username + ", isActive=" + isActive
				+ ", readerControl=" + readerControl + ", mobileUser="
				+ mobileUser + "]";
	}

	
}
